Use Case 5 - (Template H1)#
These libraries are required to run the Slovenian electricity network model and provide the core functionality needed throughout the workflow. They support tasks ranging from data preparation to the analysis and hazard assessment of the network, as well as the visualization of resulting insights.
# HIDE CODE
import os
import sys
import glob
import numpy as np
import pandas as pd
import geopandas as gpd
import pandapower as pp
from pandapower.plotting import pf_res_plotly
Directory structure#
# Get the current working directory
current_folder = os.getcwd()
sys.path.append(os.path.join(current_folder, "scripts_UC5"))
from time_series_calculations import time_series_calculations, restore_original_net, initialize_gen_tracking
from case_study_disruptions import plot_regions, create_disruption, run_predefined_simulation
from risk_assesment import case_study_results, disconnected_elements, disruption_diagnostics
from settings import define_interval, fix_geodata
Introduction#
In this UC5 simulation, we examine a worst‑case disruption scenario in which all network elements along the Sava River corridor are disconnected. Although historical evidence suggests that disruptions are more likely to occur in the upper, middle, or lower regions individually rather than simultaneously, we still evaluate how the power grid responds to a large initial shock and the subsequent cascade of disconnections caused by line or transformer overloading.
plot_regions(current_folder, "SI")
Loading rivers_gdf from local cache...
Import complete UC5 pandapower network#
The Slovenian electricity transmission grid is loaded from a compressed pickle file that contains the complete pandapower model. This file integrates ENTSO‑E‑based network topology, OSM‑derived geometries, LAU‑level regional updates, spatially distributed national consumption data, and the economic and temporal profiles of power plants—including regulation strategies and energy storage integration—consolidated into one unified dataset.#
net = pp.from_pickle(os.path.join(current_folder, "pickle_files//UC5_network.p"))
print(net)
# Save net SI single-state:
net_single_state = net.deepcopy()
# Save net bus and line copies for network reset
net_bus_copy = net.bus.copy()
net_line_copy = net.line.copy()
# Fix geodata
fix_geodata(net)
This pandapower network includes the following parameter tables:
- bus (191 elements)
- load (212 elements)
- storage (3 elements)
- gen (91 elements)
- line (282 elements)
- trafo (28 elements)
- poly_cost (94 elements)
- line_geodata (282 elements)
- bus_geodata (191 elements)
Import load profiles#
The load profiles for Slovenia are imported from a compressed pickle file, derived from the original dataset used in the EU‑wide model. The load mapping to locations of demand is performed using the KdTree Nearest Neighbour Search with additional focus on prioritizing load mapping to 110kV level.#
# Import load profiles
load_profiles = pd.read_pickle(os.path.join(current_folder, "pickle_files//load_profiles_uc5.pkl"))
start_time, end_time = define_interval(load_profiles)
load_profiles = load_profiles.loc[start_time:end_time]
Start time: 2020-08-01 00:00:00
End time: 2020-08-08 00:00:00
Hazard characterisation#
Based on historical evidence and recent analyses, the Sava River in Slovenia has shown a pattern of flooding that varies by region and season. A detailed analysis of historical floods along the Sava River in Slovenia can be found in the paper titled “ Analysis of floods on the Sava River in the historical record” by Mira Kobold (2024). It documents the largest floods in the upper, middle, and lower courses of the river, including:#
30 October 1926 in Radovljica (upper Sava corridor)
4 August 2023 in Litija (middle Sava corridor)
19 September 2010 in Čatež (lower Sava corridor)
The study notes that major floods have occurred almost every decade since the 1970s, with the August 2023 flood being the first major summer flood event on the Sava River.#
The predefined simulation allows selecting either individual major‑flood regions or a combined worst‑case scenario. In all cases, substations within a 5‑km impact radius are disconnected, forming the initial network‑level disturbance. This substation outage triggers further consequences at the asset-level through line overloads (equipment protection), and ultimately leads to systemic‑level impacts such as generation losses and demand interruptions.#
# Run predefined_simulation
#chose one of the flooding scenarios (upper/middle/lower/all)
simulation_type = "lower"
pf_results = run_predefined_simulation(net, current_folder, "SI", pd, load_profiles, pf_res_plotly, time_series_calculations, simulation_type)
Loading rivers_gdf from local cache...
affected nodes:
Index([9, 39, 48, 77, 78, 79], dtype='int64')
Best generator index: 39, max_p_mw: 423.0400203072779
Case Study Results#
case_study_results()
Case study disruption results:
Total generators costs: 1.53 million €
Maximum line loading percent: 61.1 %
Overloaded lines: 0
Number of affected buses: 0
Direct economic losses 0 million €
Indirect losses: 0.63 million €
Energy not supplied: 2143.1 MWh
Network and Asset-level risk assessment#
disconnected_elements(net)
Number of disconnected buses: 6
Number of disconnected lines: 26
Number of disconnected loads: 2
Number of disconnected generators: 10
Disconnected Lines by voltage level:
voltage
110.0 15
400.0 10
220.0 1
Name: count, dtype: int64
Disconnected Buses by voltage level:
vn_kv
110.0 5
400.0 1
Name: count, dtype: int64
Number of generators on disconnected buses:
3 Brezice - Gen 3
13 KRS - O_RES
33 NEK
38 Mokrice - Gen 2
47 KRS - PV
58 KRS - O_nonRES
62 Mokrice - Gen 1
74 Mokrice - Gen 3
80 Brezice - Gen 2
93 Brezice - Gen 1
Name: name, dtype: object
Systemic-risk assessment#
disruption_diagnostics(net)
Disconnected loads percentage of the total load: 2.91
Disconnected gens percentage of the total nominal power: 0.0
Disconnected buses percentage of the total buses: 1.05
Disconnected lines percentage of the total lines: 5.32